<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>代码雨</title>
    <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Orbitron', sans-serif;
            background-color: #000;
            color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            overflow: hidden;
        }
        
        .matrix {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background: rgba(0, 0, 0, 0.9);
            z-index: 1;
        }
    </style>
</head>
<body>
    <div class="matrix" id="matrix"></div>
    

    <script>
        
        // 代码雨效果
        const canvas = document.createElement('canvas');
        const context = canvas.getContext('2d');
        document.getElementById('matrix').appendChild(canvas);

        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;

        const letters = '0123456789ABCDEF'.split('');
        const fontSize = 16;
        const columns = canvas.width / fontSize;
        const drops = [];
        const colors = ['#FF0', '#F00', '#0F0', '#00F', '#0FF', '#F0F'];

        for (let x = 0; x < columns; x++) {
            drops[x] = 1;
        }

        function draw() {
            context.fillStyle = 'rgba(0, 0, 0, 0.05)';
            context.fillRect(0, 0, canvas.width, canvas.height);

            for (let i = 0; i < drops.length; i++) {
                context.fillStyle = colors[Math.floor(Math.random() * colors.length)];
                context.font = fontSize + 'px monospace';

                const text = letters[Math.floor(Math.random() * letters.length)];
                context.fillText(text, i * fontSize, drops[i] * fontSize);

                if (drops[i] * fontSize > canvas.height && Math.random() > 0.975) {
                    drops[i] = 0;
                }

                drops[i]++;
            }
        }

        setInterval(draw, 33);
    </script>
</body>
</html>
